package com.haidechizi.doublecache.process;


import com.haidechizi.doublecache.enums.CacheType;

public class DeleteProcessService extends BaseProcessService {

    @Override
    protected void doProcess(ProcessContext processContext) throws Throwable {
        String cacheKey = processContext.getCacheKey();
        localCacheService.deleteCache(cacheKey);
        remoteCacheService.deleteCache(cacheKey);
        Object value = processContext.proceed();
        processContext.setValue(value);
    }

    @Override
    protected String name() {
        return CacheType.DELETE.getCode();
    }
}
